home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Quill
/
Source
/
DisclosureArrowEditor.cpp
< prev
next >
Wrap
Text File
|
1997-08-09
|
4KB
|
129 lines
/*
* File: DisclosureArrowEditor.cpp
* Summary: A view that knows how to edit a TDisclosureArrow.
* Written by: Jesse Jones
*
* Copyright ゥ 1996-1997 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <2> 8/08/97 JDJ Disclosure arrows no longer support medium and large sizes.
* <1> 1/22/96 JDJ Created
*/
#include "DisclosureArrowEditor.h"
#include <ZControl.h>
// ===================================================================================
// class CEditDisclosureArrowCommand
// ===================================================================================
//---------------------------------------------------------------
//
// CEditDisclosureArrowCommand::~CEditDisclosureArrowCommand
//
//---------------------------------------------------------------
CEditDisclosureArrowCommand::~CEditDisclosureArrowCommand()
{
}
//---------------------------------------------------------------
//
// CEditDisclosureArrowCommand::CEditDisclosureArrowCommand
//
//---------------------------------------------------------------
CEditDisclosureArrowCommand::CEditDisclosureArrowCommand(TDisclosureArrow* pane, const SDisclosureInfo& oldInfo, const SDisclosureInfo& newInfo) : Inherited(pane, oldInfo, newInfo)
{
}
//---------------------------------------------------------------
//
// CEditDisclosureArrowCommand::UpdatePane
//
//---------------------------------------------------------------
void CEditDisclosureArrowCommand::UpdatePane(const SDisclosureInfo& info)
{
if (info.isDown)
mPane->FlipDown();
else
mPane->FlipUp();
}
#pragma mark -
// ===================================================================================
// CDisclosureArrowEditor
// ===================================================================================
static TReanimatorRegister<CDisclosureArrowEditor> sDisclosureArrowEditorRegistrar;
//---------------------------------------------------------------
//
// CDisclosureArrowEditor::~CDisclosureArrowEditor
//
//---------------------------------------------------------------
CDisclosureArrowEditor::~CDisclosureArrowEditor()
{
}
//---------------------------------------------------------------
//
// CDisclosureArrowEditor::CDisclosureArrowEditor
//
//---------------------------------------------------------------
CDisclosureArrowEditor::CDisclosureArrowEditor(TView* superView) : Inherited(superView)
{
}
//---------------------------------------------------------------
//
// CDisclosureArrowEditor::Create [static]
//
//---------------------------------------------------------------
MReanimatable* CDisclosureArrowEditor::Create(MReanimatable* parent)
{
return new CDisclosureArrowEditor(dynamic_cast<TView*>(parent));
}
//---------------------------------------------------------------
//
// CDisclosureArrowEditor::GetEditorInfo
//
//---------------------------------------------------------------
SDisclosureInfo CDisclosureArrowEditor::GetEditorInfo() const
{
SDisclosureInfo info;
TControl* control = nil;
control = dynamic_cast<TControl*>(this->FindSubPane("Is Down"));
info.isDown = control->GetValue();
return info;
}
//---------------------------------------------------------------
//
// CDisclosureArrowEditor::SetEditorInfo
//
//---------------------------------------------------------------
void CDisclosureArrowEditor::SetEditorInfo(const SDisclosureInfo& info)
{
TControl* control = nil;
control = dynamic_cast<TControl*>(this->FindSubPane("Is Down"));
control->SetValue(info.isDown);
}